import random
import string

def generate_duplicate_string(length=None, char_pool=None):
    """
    生成包含重复字母的随机字符串
    
    Args:
        length: 字符串长度，如果为None则随机生成5-15长度
        char_pool: 字符池，如果为None则使用小写字母a-z
    
    Returns:
        str: 包含重复字母的字符串
    """
    if length is None:
        length = random.randint(5, 15)
    
    if char_pool is None:
        char_pool = string.ascii_lowercase
    
    # 确保有重复字母，选择较少的字符进行重复
    unique_chars = random.sample(char_pool, min(length // 2 + 1, len(char_pool)))
    
    # 生成字符串，确保有重复
    result = []
    for _ in range(length):
        result.append(random.choice(unique_chars))
    
    return ''.join(result)

def generate_test_cases(num_cases=5):
    """
    生成多个测试用例
    
    Args:
        num_cases: 测试用例数量
    
    Returns:
        list: 测试用例列表
    """
    test_cases = []
    
    # 添加示例用例
    test_cases.extend(["bcabc", "cbacdcbc"])
    
    # 生成随机用例
    for _ in range(num_cases - 2):
        test_cases.append(generate_duplicate_string())
    
    return test_cases
